package com.cares.user.action;

import com.cares.event.constant.EventSystemConstant;
import com.cares.user.service.UserService;


public class LoginAction {   
    
	private UserService userService;
	
	private String username;   
    private String userpassword;   
    
    public String getUsername() {   
        return username;   
    }   
    public void setUsername(String username) {   
        this.username = username;   
    }   
  
    public String getUserpassword() {   
        return userpassword;   
    }   
  
    public void setUserpassword(String userpassword) {   
        this.userpassword = userpassword;   
    }   
  
	public String execute(){   
	    System.out.println("我进来了呢");   
	    System.out.println(this.getUsername());   
	    System.out.println(this.getUserpassword());   
	    //测试ibatis
	    //String results = userService.checkLoginedUser(this.getUsername(), this.getUserpassword());
	    //测试bibernate
	    String results = userService.doQueryLoginedUser(this.getUsername(), this.getUserpassword());
	    
	    if("0".equals(results)){   
	        return "succ";   
	    }else{   
	        return "fail";   
	    } 
	}
	public UserService getUserService() {
		return userService;
	}
	public void setUserService(UserService userService) {
		this.userService = userService;
	}   
	
	
}  